package de.koller.planet2D.frame.previewRender;

import de.koller.oceanFramework.tree.Child;
import de.koller.planet2D.PNode;
import java.awt.Graphics2D;

public class PRenderRoot extends PNode {

	private Graphics2D graphics;
	@Child public final Camera camera = new Camera();
	@Child public final BasicRenderer basicRenderer = new BasicRenderer();
	
	public void renderPreview( Graphics2D graphics ) {
		this.graphics = graphics;
		
		camera.preTransform( graphics );
		
		basicRenderer.renderBasics();
		basicRenderer.renderGrips();
		
		camera.postTransform( graphics );
	}

	public Graphics2D getGraphics() {
		return graphics;
	}
	
}
